package com.yunsc.store.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.Map;

/**
 * 省市区数据表
 * 
 * @author adan
 * @email 2028038953@qq.com
 * @date 2024-04-22 11:35:51
 */
@Data
@TableName("yunsc_region")
public class YunscRegionEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 区划信息ID
	 */
	@TableId
	private Integer id;
	/**
	 * 区划名称
	 */
	private String name;
	/**
	 * 父级ID
	 */
	private Integer pid;
	/**
	 * 区划编码
	 */
	private String code;
	/**
	 * 层级(1省级 2市级 3区/县级)
	 */
	private Integer level;


	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@TableField(exist = false)
	private Map<Integer, YunscRegionEntity> city;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@TableField(exist = false)
	private Map<Integer, YunscRegionEntity> region;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@TableField(exist = false)
	private Map<Integer, YunscRegionEntity> children;
}
